from learn import create_app, Video, LeadingActor, jsonify, app


@app.route("/video/all", methods=["GET"])
def video():
    vdo = Video.query.all()
    listData: list = []
    for i in vdo:
        dict = {'id': i.id, 'name': i.name, 'time': i.time, 'director': i.director, 'content': i.content, 'url': i.url,
                'img_url': i.img_url}
        listData.append(dict)
    return jsonify(message="成功", status=200, data=listData)


app.run(host="0.0.0.0")
